/*******************************************************************************
 * Copyright (c) 2011 TXT e-solutions SpA
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * This work was performed within the IoT_at_Work Project
 * and partially funded by the European Commission's
 * 7th Framework Programme under the research area ICT-2009.1.3
 * Internet of Things and enterprise environments.
 *
 *
 * Authors:
 *     Cristoforo Seccia (TXT e-solutions SpA)
 *
 * Contributors:
 *      Domenico Rotondi (TXT e-solutions SpA)
 *******************************************************************************/
package it.txt.access.capability.commons.utils;

import java.util.ArrayList;

/**
 * A collection of W3C DOM helper methods
 *
 */
public class ClientServerUtils {

    
    //The standard create operation.
    public static final String OPERATION_CREATE = "CREATE";
    //The standard read operation.
    public static final String OPERATION_READ = "READ";
    //The standard update operation.
    public static final String OPERATION_UPDATE = "UPDATE";
    //The standard delete operation.
    public static final String OPERATION_DELETE = "DELETE";
    //The well know CRUD operations list.
    public static final ArrayList<String> CRUD_LIST = new  ArrayList<String>();
    //Put the CRUD operations in the list.
    static {
        CRUD_LIST.add(OPERATION_CREATE);
        CRUD_LIST.add(OPERATION_READ);
        CRUD_LIST.add(OPERATION_UPDATE);
        CRUD_LIST.add(OPERATION_DELETE);
    }
    //Send by the server into a plain message to allert the client about the connection.
    public static final String RESPONSE_CONNECTION_SUCCESS = "CONNECTION_OK";

    //Used by the server into the xml response if the received request is invalid.
    public static final String INVALID_REQUEST_ID = "NULL";

    //Used by the server if an internal error occurs.
    public static final String INVALID_RESPONSE_ID = "NULL";

    //Used by the server into the xml response if the request capability is valid according to the capability.
    public static final String RESPONSE_CAPABILITY_VALID = "The Capability specified into the request is valid.";

    //Used by the server into the xml response if the request capabilitty is invalid according to the capability.
    public static final String RESPONSE_CAPABILITY_INVALID = "The Capability specified into the request is invalid.";

    //Used by the server after the RESPONSE_CAPABILITY_VALID if the operation it has been performed.
    public static final String RESPONSE_REQUEST_OPERATION_PERFORMED = "Operation successfully performed.";

    //Used by the server after the RESPONSE_CAPABILITY_VALID if the operation it has not been performed.
    public static final String RESPONSE_REQUEST_OPERATION_NOT_PERFORMED = "The specified operation can not be performed.";

    //Send by the server into a plain message to allert the client about an internal error.
    public static final String RESPONSE_INTERNAL_ERROR = "The server occurred an internal error.";
}
